package net.kleinhenz.norabase.client.datasource;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;


import java.util.List;
import java.util.Map;

import net.kleinhenz.norabase.shared.SortOrientation;
import net.kleinhenz.norabase.shared.TextMatchStyle;
import net.kleinhenz.norabase.shared.model.Spell;

@RemoteServiceRelativePath("spellds")
public interface SpellDSService extends RemoteService {

    List<Spell> fetch(int start, int end, Map<String, SortOrientation> sortSpec, TextMatchStyle textMatchStyle, Map<String, Object> criteria);
	Spell update(Spell record);

    public static class Util {
		private static SpellDSServiceAsync instance;
		public static SpellDSServiceAsync getInstance() {
			return (instance == null) ? (instance = GWT.create(SpellDSService.class)) : instance;
		}
	}
}
